#ifndef UNIT_UTILS_HPP_INCLUDED
#define UNIT_UTILS_HPP_INCLUDED

#include <string>
#include <vector>

#include "texture.hpp"
#include "unit.hpp"

namespace game {

graphics::texture get_unit_image(const unit_type& a);
graphics::texture get_unit_image(const unit& a);

bool units_hostile(const unit& a, const unit& b);
int calculate_unit_attack(const unit& u, const unit& target, std::vector<std::string>* explanation=0);
int calculate_unit_defense(const unit& u, const unit& target, std::vector<std::string>* explanation=0);

int unit_color_index(const unit& u);

bool is_commander(const unit& u);

bool is_ezoc(const unit& u, const hex::location& loc);

bool units_moving();

class TempLocationSetter {
	unit& unit_;
	hex::location initial_loc_;
public:
	TempLocationSetter(unit& u, const hex::location& loc);
	~TempLocationSetter();
};

}

#endif
